From: Stefan Monnier Date: Thu, 19 Jul 2007 18:49:59 +0000 (+0000) Subject: (vc-find-root): Walk up the tree to find an existing X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~17815 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=de8bc3eec134a447bf2eb40fc0e83b4b9c8e4973;p=emacs.git (vc-find-root): Walk up the tree to find an existing `file' from which to start the search. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2452af2ba5c..e9c79bea277 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,10 +1,14 @@ +2007-07-19 Stefan Monnier + + * vc-hooks.el (vc-find-root): Walk up the tree to find an existing + `file' from which to start the search. + 2007-07-19 Eric S. Raymond - * vc-cvs.el: vc-cvs-checkin had some reference problems, now - fixed. - + * vc-cvs.el: vc-cvs-checkin had some reference problems, now fixed. 2007-07-19 Stefan Monnier + * files.el (locate-dominating-file): New function. 2007-07-18 Michael Albinus diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 809b49a4d0e..19b309ee203 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -317,6 +317,8 @@ The function walks up the directory tree from FILE looking for WITNESS. If WITNESS if not found, return nil, otherwise return the root." ;; Represent /home/luser/foo as ~/foo so that we don't try to look for ;; witnesses in /home or in /. + (while (not (file-exists-p file)) + (setq file (file-name-directory (directory-file-name file)))) (setq file (abbreviate-file-name file)) (let ((root nil) (user (nth 2 (file-attributes file))))